package com.atguigu.srb.core.controller.api;

import com.atguigu.srb.common.result.R;
import com.atguigu.srb.core.pojo.entity.Dict;
import com.atguigu.srb.core.service.DictService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/core/dict")
public class ApiDictController {
    @Resource
    private DictService dictService;
    @GetMapping("/getDictListByDictCode/{dictCode}")
    public R getDictListByDictCode(@PathVariable("dictCode") String dictCode){
        List<Dict> dictList = dictService.getDictListByDictCode(dictCode);
        return R.ok().data("dictList",dictList);
    }

}
